#!/usr/local/BLBIN/bin/php
<?php

function get_request($url)
{
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);
	return trim($response);
}

function liveExecuteCommand($cmd)
{
	$a = popen($cmd, 'r');

	while ($b = fgets($a, 2048)) {
		echo $b;
		ob_flush();
		flush();
	}

	pclose($a);
}
function exec_output($cmd)
{
	exec($cmd, $output, $return_var);

	if (1 < count($output)) {
		return join("\r\n", $output);
	}

	return $output[0];
}
function exec_cmd($cmd)
{
	exec($cmd, $output, $result_code);

	if (1 < count($output)) {
		return join("\r\n", $output);
	}

	return $output[0];
}

function check_license_expire()
{
	global $key;
	system('mkdir -p /usr/local/CL > /dev/null 2>&1');
	$private = '-----BEGIN PRIVATE KEY-----' . "\r\n" . 'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5Hq/0a7g3fR9Y' . "\r\n" . '7IteOpM9FIgocmBa/V7TkURXdT+5y3OpVED/FGyQ+WoBWi5bym6CgTlp5bM6QvTe' . "\r\n" . 'QAoVNvDyRjxB4dENBhls/Gr9B1JBcuG6pm1Ruizhu8NsfL5hiCbyZGzSu7L7LKaz' . "\r\n" . '457RoJ01pH7p8IVKxJdW1vNsTiCLgTLgjePkO/hTQJMwO6MvXnpQ3ViI8kECThVS' . "\r\n" . 'lkhrz4UveenmJXBaop038MW2Y0VtVWFaDBdJ+HFN6tueKhIEGbgkB//TyGBuPAS4' . "\r\n" . 'XDe7MQVzg8OUz8NAFrWcJBmVUep8qiDJwVm2m5AvMiUHN4SVyk5wgVZ6XtGeiuOZ' . "\r\n" . 'MUfCQeM3AgMBAAECggEATiIKqAIzLZBtA65LIIlejeA1m8SysJTSSj+89aDyNawO' . "\r\n" . 'dECwcjkfnYz31fxHJszpGcILBoxBumx6R7gFyXB3//nvAuuZvYJ+hsZ/La7CZAdm' . "\r\n" . 'CM6nw1/uA5SpZge8nxPFRHdoiwVYBLWS4shGxzmgQPzd6EVxLN6O9cMh2OucxuQY' . "\r\n" . 'G8HgZ8akklpG8GRiYCesDdHVNycSbm+KrpkMgFVsVbZ2U3kKoti9D3XS24a5vSD0' . "\r\n" . 'kmbkftljpiMZOnHlGGLEIfWFO8ZeS27CvTK1mYgJEibdSTHAsqbH11lw7AUtkIdD' . "\r\n" . 'JGldC+7RElS0bs5X08Vmt/IOeC/MBUa5mWgbUGsLmQKBgQDlk3T0qVLwjduNNFBX' . "\r\n" . 'OxmOI/yQPK5r3xwd6PJx4wxjFzBqq4U3Ew7Jxim2U3BrphliyZ81LwxfTVoJIN1i' . "\r\n" . 'gphkBx3vt3FF9TwFIYh4iQK9U4LCi5aJ6LenjK/UrRz9L9+A3+nabrBCNyKgkdwH' . "\r\n" . 'UaLrPutV7XxNkhdKhI3/bI0ZfQKBgQDObVBZ86DnVSlo6a8Yfe0g6hrdqumJSe+8' . "\r\n" . 'vDlZor3QjtELQ/9o0rZWnyVt8M/MxsZBmBpD/yiTBR8YM56+bBTUF6RooZPcedK7' . "\r\n" . 'JkYobA4bKbaB2sN3LcjaO0+Bk/VZfhgQQwR0CvCZLEnCv5yQYGXRCXfPDYaMQc72' . "\r\n" . 'rJ2JsCatwwKBgCiM+0OcBQJojDdM3kQKNGFfCeWQUl7LcfP2iZyENlPqbKrq0QUB' . "\r\n" . 'YMNTNVr3MgxRsno4kt6aCN1slFK4c2JLHw/MEgWdqWxp/MgLPEfOK6W1cotajKSf' . "\r\n" . 'bpEx0H0Idu5h3mCtLGlg09FeW8dw/CRuzxAudPMgl6w7+dE3yL0tN18hAoGABYCu' . "\r\n" . 'eqde66u+fdh03W9F6fGzo6MRtKIu7NYLpVMMQkn8UpOOdGnhiG+XnNWlhGzsDgWS' . "\r\n" . '9asQltK1IH0Hx0W0TG8Q5+UevurUbj638g3nVlwHTHDbcwraZs7b8LVT/f25gH14' . "\r\n" . '2esMvNiMYs+eyc54CFl7Qx62Lnj2nma9kFUMwucCgYEAsE/NPUBp/lLuGqSR+quj' . "\r\n" . 'sgdTIbttscOF5K+CYThJjBIAI4sMHC1qxgDgf0BAhUiL2NciQ6aIniSCkIoF5bpM' . "\r\n" . 'V7YU+L/ugiOfGVhFsji4X8E00dkqWHUZ1EaDCccoMV/gKKAbnsofUF6w4U/mk3bH' . "\r\n" . 'p2uA5sF5fX+kO3sqKGwfgoI=' . "\r\n" . '-----END PRIVATE KEY-----';

	if (!file_exists('/usr/local/CL/.licensekeycp2')) {
		exec('wget -O /usr/local/CL/.licensekeycp2 https://wc.cloudlicense.shop/api/' . $key . '/getlicense > /dev/null 2>&1');
		$getdata = file_get_contents('/usr/local/CL/.licensekeycp2');
		$file = json_decode($getdata, true);
		$data = base64_decode($file['sig']);
		$decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
		$json = json_decode($decrypted_1, true);
		$valid = $json['second'];
		$validdate = date('m/d/Y h:i:s a', time());
		$valid2 = strtotime($validdate);
	}
	else {
		$getdata = file_get_contents('/usr/local/CL/.licensekeycp2');
		$file = json_decode($getdata, true);
		$data = base64_decode($file['sig']);
		$decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
		$json = json_decode($decrypted_1, true);
		$valid = $json['second'];
		$validdate = date('m/d/Y h:i:s a', time());
		$valid2 = strtotime($validdate);
	}

	if (0 <= $valid2 - $valid) {
		exec('wget -O /usr/local/CL/.licensekeycp2 https://wc.cloudlicense.shop/api/' . $key . '/getlicense > /dev/null 2>&1');
		$getdata = file_get_contents('/usr/local/CL/.licensekeycp2');
		$file = json_decode($getdata, true);
		$data = base64_decode($file['sig']);
		$decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
		$json = json_decode($decrypted_1, true);
		$valid = $json['second'];
		$validdate = date('m/d/Y h:i:s a', time());
		$valid2 = strtotime($validdate);

		if (0 <= $valid2 - $valid) {
			exec('chmod +x /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
			exec('chmod +x /usr/local/cpanel/cpkeyclt > /dev/null 2>&1');
			exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
			exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
			exec('chattr -i /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
			exec('chattr -i /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
			exec('chattr -a /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
			exec('chattr -a /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
			exec('rm -rf /usr/local/cpanel/.lgbt > /dev/null 2>&1');

			if (file_exists('cp /usr/local/cpanel/scripts/restartsrv_cpsrvd1')) {
				exec('yes 2>/dev/null | cp /usr/local/cpanel/scripts/restartsrv_cpsrvd1 /usr/local/cpanel/scripts/restartsrv_cpsrvd');
			}

			exec('chmod +x /usr/local/cpanel/scripts/restartsrv_cpsrvd');
			exec('chattr -a /usr/local/cpanel/cpkeyclt 2> /dev/null');
			exec('rm -rf /usr/local/cpanel/cpsanitycheck.*');
			exec('rm -rf /usr/local/cpanel/cpane*.lis*');
			return true;
		}
	}

	return false;
}

function checkLicense()
{
		$output_check_license = exec_output('/usr/local/cpanel/uapi');
		if (!preg_match('/Licensed on/', $output_check_license)) {
			$status = false;
			exec('/usr/bin/LicenseCP');
		}
else {
			$status = true;
		}
}

function get_domain_status($domain1)
{
	$ch = curl_init($domain1);
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_NOBODY, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 10);
	$output = curl_exec($ch);
	$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	curl_close($ch);
	return $httpcode;
}

$RED = '\\033[31m';
$Green = '\\033[32m';
$NC = '\\033[0m';
$key = 'cpanelv3';
$api = 'https://wc.cloudlicense.shop/api/getinfo?key=' . $key;
$api_license = 'https://wc.cloudlicense.shop/api/license?key=' . $key;
$status_code = get_domain_status((string) $api);
$plast_bin = '/usr/bin/plast';
$ip = get_request('https://ipinfo.io/ip');
$domain_show = 'Cloudlicense.shop';
$brand_show = 'Cloudlicense';
$hostname_show = exec_cmd('hostname');
$server_type = 'VPS';
$channel = 'Stable';
$softwarename = 'cPanel';
$kernel = exec_cmd('uname -r');
$acc = exec('find "/var/cpanel/users" -maxdepth 1 -type f -print | wc -l');
$cpanelversion = exec_cmd('cat /usr/local/cpanel/version');
$load = exec_cmd('cat /proc/loadavg');
$os = exec_cmd('hostnamectl | grep -i "Operating System" ');
$virtualization = exec_cmd('hostnamectl | grep -i "Virtualization" ');
$status = false;
$server_range = 0;
$cp = exec('cat /usr/local/cpanel/version');
$ver = '2.1';
$dns = '/usr/local/cpanel/cpanel.lisc';
$key_cmd = 'gb';
$fogbe = false;
$action = (1 < count($argv) ? $argv[1] : '');
if (in_array('--fogbe', $argv) || in_array('-f', $argv) || in_array('fogbe', $argv)) {
	$fogbe = true;
}
if (($argv[1] == '-check-license') || ($argv[1] == '--check--license')) {
	if ($status_code != '200') {
		echo "\r\n" . '' . "\x1b" . '[31m Your License has been suspended. Connect to support via ' . $domain_show . ' ' . "\x1b" . '[0m' . "\r\n";
		exec('cp /usr/local/RC/cpanel_rc /usr/local/cpanel/cpanel > /dev/null 2>&1');
		exec('cp /usr/local/RC/uapi_rc /usr/local/cpanel/uapi > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
		exec('cp /usr/local/RC/cpsrvd_rc /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr_rc /usr/local/cpanel/whostmgr/bin/whostmgr > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr2_rc /usr/local/cpanel/whostmgr/bin/whostmgr2 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr4_rc /usr/local/cpanel/whostmgr/bin/whostmgr4 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr5_rc /usr/local/cpanel/whostmgr/bin/whostmgr5 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr6_rc /usr/local/cpanel/whostmgr/bin/whostmgr6 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr7_rc /usr/local/cpanel/whostmgr/bin/whostmgr7 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr9_rc /usr/local/cpanel/whostmgr/bin/whostmgr9 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr10_rc /usr/local/cpanel/whostmgr/bin/whostmgr10 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr11_rc /usr/local/cpanel/whostmgr/bin/whostmgr11 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr12_rc /usr/local/cpanel/whostmgr/bin/whostmgr12 > /dev/null 2>&1');
		exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
		exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
		exec('cp /usr/local/RC/queueprocd_rc /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/icore/socket.so.1 > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/icore/lkey > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/.mylib > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
		exec('rm -rf /etc/letsencrypt-cpanel.licence > /dev/null 2>&1');
		exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
		echo "\n";
		exit();
		}
	else {
		$output_check_license = exec_output('/usr/local/cpanel/cpanel');
		if (!preg_match('/Licensed on/', $output_check_license)) {
			exec('/usr/bin/LicenseCP');
		}
	exit();
	}
}

////////exec('yum remove dkms -y > /dev/null 2>&1');
exec('/usr/bin/rm /usr/local/cpanel/logs/license_log > /dev/null 2>&1');
$output = get_request($api);
$output = get_request($api);

if ($status_code != '200') {
	echo "\r\n" . '' . "\x1b" . '[31m Your License has been suspended. Connect to support via ' . $domain_show . ' ' . "\x1b" . '[0m' . "\r\n";
	exec('cp /usr/local/RC/cpanel_rc /usr/local/cpanel/cpanel > /dev/null 2>&1');
	exec('cp /usr/local/RC/uapi_rc /usr/local/cpanel/uapi > /dev/null 2>&1');
	exec('rm -rf /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
	exec('cp /usr/local/RC/cpsrvd_rc /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr_rc /usr/local/cpanel/whostmgr/bin/whostmgr > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr2_rc /usr/local/cpanel/whostmgr/bin/whostmgr2 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr4_rc /usr/local/cpanel/whostmgr/bin/whostmgr4 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr5_rc /usr/local/cpanel/whostmgr/bin/whostmgr5 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr6_rc /usr/local/cpanel/whostmgr/bin/whostmgr6 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr7_rc /usr/local/cpanel/whostmgr/bin/whostmgr7 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr9_rc /usr/local/cpanel/whostmgr/bin/whostmgr9 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr10_rc /usr/local/cpanel/whostmgr/bin/whostmgr10 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr11_rc /usr/local/cpanel/whostmgr/bin/whostmgr11 > /dev/null 2>&1');
	exec('cp /usr/local/RC/whostmgr12_rc /usr/local/cpanel/whostmgr/bin/whostmgr12 > /dev/null 2>&1');
	exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
	exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
	exec('rm -rf /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
	exec('cp /usr/local/RC/queueprocd_rc /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
	exec('rm -rf /usr/local/RCBIN/icore/socket.so.1 > /dev/null 2>&1');
	exec('rm -rf /usr/local/RCBIN/icore/lkey > /dev/null 2>&1');
	exec('rm -rf /usr/local/RCBIN/.mylib > /dev/null 2>&1');
	exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
	exec('rm -rf /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
	exec('rm -rf /etc/letsencrypt-cpanel.licence > /dev/null 2>&1');
	exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
	echo "\n";
	exit();
}

$output = json_decode($output, true);
$expire_date = $output['expire_date'];
$get_domain_show = $output['domain_name'];
$get_brand_show = $output['brand_name'];
$get_key_cmd_show = $output['key_cmd'];
$today_date = exec('curl -s https://wc.cloudlicense.shop/date ');

if ($get_key_cmd_show != '') {
	$key_cmd = $get_key_cmd_show;
}

if ($get_domain_show != '') {
	$domain_show = $get_domain_show;
}

if ($get_brand_show != '') {
	$brand_show = $get_brand_show;
}

exec('rm -rf /usr/bin/GbCpanel > /dev/null 2>&1');
exec('rm -rf /etc/cron.d/license* > /dev/null 2>&1');
exec('rm -rf /etc/cron.d/gb* > /dev/null 2>&1');
exec('rm -rf /etc/cron.d/CSP* > /dev/null 2>&1');
exec('rm -rf /etc/cron.d/licsys* > /dev/null 2>&1');
exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=gbcPanelStarted > /dev/null 2>&1');
exec('rm -rf /usr/local/cpanel/logs/license_log > /dev/null 2>&1');
system('clear');
echo "\n";
printf("\x1b" . '[1;33m--------------------Starting the installation process------------------' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Our Website: ' . $domain_show . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  License Name: ' . $softwarename . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  License Version: ' . $ver . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  License Channel: ' . $channel . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m' . $os . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  cPanel version: ' . $cpanelversion . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Kernel version: ' . $kernel . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Total Accounts: ' . $acc . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Load Avarage: ' . $load . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Server type: ' . $server_type . ' ' . $virtualization . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Server IP: ' . $ip . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Hostname: ' . $hostname_show . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Renewal date: ' . $expire_date . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m  Today date: ' . $today_date . '  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;33m----------------------------------------------------------------------- ' . "\x1b" . '[0m ' . "\n");
echo "\n";
echo "\n";
printf("\x1b" . '[1;36mIf you have any question contact us on our website.  ' . "\x1b" . '[0m ' . "\n");
printf("\x1b" . '[1;36mCopyright © 2022 ' . $brand_show . ' . All rights reserved ' . "\x1b" . '[0m ' . "\n");
echo "\n\n";
$output = get_request($api);

if (file_exists('/usr/local/cpanel/cpconf')) {
	if ($status_code = '200') {
		exec('rm -rf /usr/local/RC/rccp.p* > /dev/null 2>&1');
		exec('rm -rf /usr/local/RC/rccp.result > /dev/null 2>&1');
		$lock = '/root/RCCP.lock';

		if (file_exists($lock)) {
			exec('sed \'s/^ *//g\' /usr/local/RC/.rccp.pid1 > /usr/local/RC/.rccp.pid 2>&1');
			$pid = file_get_contents('/usr/local/RC/.rccp.pid');
			exec('ps -ef | grep ' . $pid . '');
			$filexml = file_get_contents('/usr/local/RC/.rccp.result');
			$pose = strpos($filexml, 'vmfi0');

			if ($pose !== false) {
				echo "\n\n" . 'cPanel license is already running. To stop the process please run the following command :';
				echo "\n" . 'rm -rf /root/RCCP.lock' . "\n";
			}
			else {
				exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
				echo "\n\n" . 'cPanel license LOCK file exists but not running... removing it...' . "\n";
			}
		}
		else {
			if (file_exists('/usr/local/RC')) {
			}
			else {
				exec('mkdir /usr/local/RC > /dev/null 2>&1');
			}

			if (file_exists('/usr/local/RCBIN')) {
			}
			else {
				exec('mkdir /usr/local/RCBIN > /dev/null 2>&1');
			}

			if (file_exists('/usr/local/RCBIN/icore')) {
			}
			else {
				exec('mkdir /usr/local/RCBIN/icore > /dev/null 2>&1');
			}

			if (file_exists('/usr/local/cpanel/cpanel_rc')) {
				exec('mv /usr/local/cpanel/*_rc /usr/local/RC > /dev/null 2>&1');
			}

			if (file_exists('/usr/local/cpanel/whostmgr/bin/whostmgr_rc')) {
				exec('mv /usr/local/cpanel/whostmgr/bin/*_rc /usr/local/RC > /dev/null 2>&1');
			}

			$filename = '/usr/bin/CLchain';

			if (file_exists($filename)) {
				exec('chmod +x /usr/bin/CLchain > /dev/null 2>&1');
			}
			else {
				exec('wget -O /usr/bin/CLchain http://wc.cloudlicense.shop/api/files/cpanelv3/CLchain > /dev/null 2>&1');
				exec('chmod +x /usr/bin/CLchain > /dev/null 2>&1');
			}

			if (file_exists('/usr/bin/LicenseCP')) {
			}
			else {
				exec('wget -O /usr/bin/LicenseCP http://wc.cloudlicense.shop/api/files/cpanelv3/LicenseCP?key=cpanelv3 > /dev/null 2>&1');
				exec('chmod +x /usr/bin/LicenseCP > /dev/null 2>&1');
				exec('chattr +i +a /usr/bin/LicenseCP > /dev/null 2>&1');
			}

			$file = exec('/usr/bin/CLchain > /usr/local/RC/.commandstatus');
			$file2 = file_get_contents('/usr/local/RC/.commandstatus');
			$pos = strpos($file2, 'Usage:');

			if ($pos !== false) {
			}
			else {
				exec('mkdir /root/.core > /dev/null 2>&1; cd /root/.core; /usr/bin/rm -rf proxychains-ng > /dev/null 2>&1; git clone https://github.com/rofl0r/proxychains-ng.git > /dev/null 2>&1 ; cd proxychains-ng > /dev/null 2>&1; ./configure > /dev/null 2>&1; make > /dev/null 2>&1; make install > /dev/null 2>&1; make install-config > /dev/null 2>&1; /usr/bin/rm -rf /usr/local/etc/proxychains.conf; /usr/bin/rm -rf /root/proxychains-ng > /dev/null 2>&1');
				exec('cd /root/.core/proxychains-ng > /dev/null 2>&1 && mv proxychains4 /usr/bin/CLchain > /dev/null 2>&1');
			}

			exec('rm -rf /usr/local/RC/.commandstatus > /dev/null 2>&1');
			exec('rm -rf /root/.core > /dev/null 2>&1');
			if (($argv[1] == '-rcdownload') || ($argv[1] == '--rcdownload')) {
				exec('sed -i \'s/auth.cpanel.net/auth.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth2.cpanel.net/auth2.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth10.cpanel.net/auth10.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth5.cpanel.net/auth5.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth7.cpanel.net/auth7.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth9.cpanel.net/auth9.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/auth3.cpanel.net/auth3.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				exec('sed -i \'s/cpanel.lisc/cpanel.lis0/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
				echo "\n" . 'Done';
				exec('rm -rf /root/RCCP.lock');
				exit();
			}

			exec('rm -rf /usr/local/cpanel/logs/versions > /dev/null 2>&1');
			exec('echo "/usr/bin/LicenseCP" > /usr/local/cpanel/scripts/postupcp');
			exec('touch /root/RCCP.lock');
			exec('echo $(ps -o ppid= -p "$$") "| grep -v grep > /usr/local/RC/.rccp.result" > /usr/local/RC/.rccp.pid1');
			if (($argv[1] == '-cpanel-update') || ($argv[1] == '--cpanel-update')) {
				exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
				exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
				exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
				exec('iptables -t nat -F > /dev/null 2>&1');
				exec('iptables -t mangle -F > /dev/null 2>&1');
				exec('iptables -F > /dev/null 2>&1');
				exec('iptables -X > /dev/null 2>&1');
				echo "\n" . '|| cPanel Updating files...' . "\n";
				exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
				exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
				exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
				exec('iptables -t nat -F > /dev/null 2>&1');
				exec('iptables -t mangle -F > /dev/null 2>&1');
				exec('iptables -F > /dev/null 2>&1');
				exec('iptables -X > /dev/null 2>&1');
				exec('rm -rf /usr/local/cpanel/logs/license_log > /dev/null 2>&1');
				echo 'Updating cPanel using --force flag ...' . "\n\n";
				exec('rm -rf /var/cpanel/dnsonly > /dev/null 2>&1');
				exec('touch /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
				exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=cpanelupdating3 > /dev/null 2>&1');
				system('/scripts/upcp --force');
				exit();
			}
			else if (($argv[1] == '-install-ssl-service') || ($argv[1] == '--install-ssl-service')) {
				echo "\n" . 'Installing SSL on cPanel services ...' . "\n";
				exec('rm -rf acme.sh');
				exec('rm -rf /root/.acme.sh/ca.cer');
				exec('rm -rf /root/.acme.sh/cert.cer');
				exec('rm -rf /root/.acme.sh/private.key');
				exec('rm -rf /root/.acme.sh/' . exec('hostname') . '');
				exec('cd /root && git clone https://github.com/Neilpang/acme.sh.git > /dev/null 2>&1 ; cd ./acme.sh && ./acme.sh --install -m zcdzsrlx@hi2.in > /dev/null 2>&1 && ./acme.sh --issue -d ' . exec('hostname') . ' -w /var/www/html > /dev/null 2>&1');
				exec('mv /root/.acme.sh/' . exec('hostname') . '/' . exec('hostname') . '.key /root/.acme.sh/private.key > /dev/null 2>&1');
				exec('mv /root/.acme.sh/' . exec('hostname') . '/' . exec('hostname') . '.cer /root/.acme.sh/cert.cer > /dev/null 2>&1');
				exec('mv /root/.acme.sh/' . exec('hostname') . '/ca.cer /root/.acme.sh/ca.cer > /dev/null 2>&1');
				exec('timedatectl set-timezone GMT');
				$cert = file_get_contents('/root/.acme.sh/cert.cer');
				$key = file_get_contents('/root/.acme.sh/private.key');
				exec('sed -i \'/-----END CERTIFICATE-----/q\' /root/.acme.sh/ca.cer');
				$ca = file_get_contents('/root/.acme.sh/ca.cer');
				exec('chmod +x /usr/local/cpanel/cpsrvd');
				$cert1 = urlencode($cert);
				$key1 = urlencode($key);
				$ca1 = urlencode($ca);
				echo "\x1b" . '[0mInstalling SSL on FTP...' . "\x1b" . '[0m';
				exec('/usr/sbin/whmapi1 install_service_ssl_certificate service=ftp crt=' . $cert1 . ' key=' . $key1 . ' cabundle=' . $ca1 . '');
				exec('/scripts/restartsrv_ftpd');
				exec('/scripts/restartsrv_ftpserver');
				echo "\x1b" . '[32mOK' . "\x1b" . '[0m' . "\n";
				echo "\x1b" . '[0mInstalling SSL on Exim...' . "\x1b" . '[0m';
				exec('/usr/sbin/whmapi1 install_service_ssl_certificate service=exim crt=' . $cert1 . ' key=' . $key1 . ' cabundle=' . $ca1 . '');
				exec('/scripts/restartsrv_exim');
				echo "\x1b" . '[32mOK' . "\x1b" . '[0m' . "\n";
				echo "\x1b" . '[0mInstalling SSL on dovecot...' . "\x1b" . '[0m';
				exec('/usr/sbin/whmapi1 install_service_ssl_certificate service=dovecot crt=' . $cert1 . ' key=' . $key1 . ' cabundle=' . $ca1 . '');
				exec('/scripts/restartsrv_dovecot');
				echo "\x1b" . '[32mOK' . "\x1b" . '[0m' . "\n";
				echo "\x1b" . '[0mInstalling SSL on cPanel...' . "\x1b" . '[0m';
				exec('/usr/sbin/whmapi1 install_service_ssl_certificate service=cpanel crt=' . $cert1 . ' key=' . $key1 . ' cabundle=' . $ca1 . '');
				exec('/scripts/restartsrv_cpsrvd');
				echo "\x1b" . '[32mOK' . "\x1b" . '[0m' . "\n";
				exec('chmod +x /usr/local/cpanel/cpsrvd');
				echo "\n" . 'Done. Thank you' . "\n";
				exec('rm -rf /root/acme.sh');
				exec('rm -rf /root/RCCP.lock');
				exit();
			}
			else {
				if (($argv[1] == '-fleetssl') || ($argv[1] == '--fleetssl')) {
					echo 'Installing FleetSSL license for cPanel ...';
					exec('yum remove letsencrypt-cpanel* -y > /dev/null 2>&1');
					exec('wget -O /etc/letsencrypt-cpanel.licence https://wc.cloudlicense.shop/api/files/cpanelv3/letsencrypt > /dev/null 2>&1');
					exec('wget -O /usr/local/RC/rcssl.rpm http://mirror.cloudlicense.shop/letsencrypt-cpanel-0.16.2-1.x86_64.rpm > /dev/null 2>&1');
					exec('yum localinstall /usr/local/RC/rcssl.rpm -y > /dev/null 2>&1');
					exec('rm -rf /usr/local/RC/rcssl.rpm > /dev/null 2>&1');
					echo 'Done. Thank you' . "\n";
					exec('rm -rf /root/RCCP.lock');
					exit();
				}
				if (($argv[1] == '-wordpress-toolkit') || ($argv[1] == '--wordpress-toolkit')) {
					echo 'Installing WordPress toolkit for cPanel ...';
					exec('wget -O /root/wordpresstoolkit.sh https://wp-toolkit.plesk.com/cPanel/installer.sh > /dev/null 2>&1');
					exec('chmod +x /root/wordpresstoolkit.sh > /dev/null 2>&1');
					exec('/root/wordpresstoolkit.sh');
					exec('rm -rf /root/wordpresstoolkit.sh > /dev/null 2>&1');
					echo "\n\n" . 'Done. Thank you' . "\n";
					exec('rm -rf /root/RCCP.lock');
					exit();
				}
				if (($argv[1] == '-help') || ($argv[1] == '--help') || ($argv[1] == '--h') || ($argv[1] == '-h')) {
					echo "\r\n" . 'List of available commands :' . "\r\n\r\n" . '-wordpress-toolkit              Install wordpress toolkit for cPanel' . "\r\n" . '-fleetssl                       Install FleetSSL + generate valid FleetSSL license' . "\r\n" . '-install-ssl-service            Install SSL on all cPanel services (such as hostname , exim , ftp and etc)' . "\r\n" . '-cpanel-update                  Update cPanel to latest version (Force mode)' . "\r\n" . '-install-letsencrypt            Install LetsEncrypt for AutoSSL' . "\r\n";
					exec('rm -rf /root/RCCP.lock');
					exit();
				}
				if (($argv[1] == '-uninstall') || ($argv[1] == '--uninstall')) {
					echo 'Uninstalling cPanel licensing system...' . "\n";
					exec('cp /usr/local/RC/cpanel_rc /usr/local/cpanel/cpanel > /dev/null 2>&1');
					exec('cp /usr/local/RC/uapi_rc /usr/local/cpanel/uapi > /dev/null 2>&1');
					exec('rm -rf /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
					exec('cp /usr/local/RC/cpsrvd_rc /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr_rc /usr/local/cpanel/whostmgr/bin/whostmgr > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr2_rc /usr/local/cpanel/whostmgr/bin/whostmgr2 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr4_rc /usr/local/cpanel/whostmgr/bin/whostmgr4 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr5_rc /usr/local/cpanel/whostmgr/bin/whostmgr5 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr6_rc /usr/local/cpanel/whostmgr/bin/whostmgr6 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr7_rc /usr/local/cpanel/whostmgr/bin/whostmgr7 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr9_rc /usr/local/cpanel/whostmgr/bin/whostmgr9 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr10_rc /usr/local/cpanel/whostmgr/bin/whostmgr10 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr11_rc /usr/local/cpanel/whostmgr/bin/whostmgr11 > /dev/null 2>&1');
					exec('cp /usr/local/RC/whostmgr12_rc /usr/local/cpanel/whostmgr/bin/whostmgr12 > /dev/null 2>&1');
					exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
					exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
					exec('rm -rf /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
					exec('cp /usr/local/RC/queueprocd_rc /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
					exec('rm -rf /usr/local/RCBIN/icore/socket.so.1 > /dev/null 2>&1');
					exec('rm -rf /usr/local/RCBIN/icore/lkey > /dev/null 2>&1');
					exec('rm -rf /usr/local/RCBIN/.mylib > /dev/null 2>&1');
					exec('rm -rf /etc/cron.d/clCpanelv3 > /dev/null 2>&1');
					exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
					exec('rm -rf /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
					exec('service RCCP stop > /dev/null 2>&1');
					exec('rm -rf /root/RCCP.lock');
					echo 'Done. please update your cPanel using /scripts/upcp --force' . "\n";
					exit();
				}

				if ($server_output == 'OK') {
					exec('service tor restart > /dev/null 2>&1');
				}
            if (($argv[1] == '-verify') || ($argv[1] == '--verify')) {
               $currentversion = file_get_contents('/usr/local/cpanel/version');
					$currentversion = str_replace("\n", '', $currentversion);
					echo 'Verifying your IP on cpanel database ...'. "\n\n";
					exec('touch /etc/.verifylicense > /dev/null 2>&1');
					exec('wget -O /usr/local/RCBIN/reg.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c7-x86_64/cpkeyclt.xz > /dev/null 2>&1');
					exec('unxz /usr/local/RCBIN/reg.xz > /dev/null 2>&1');
					exec('chmod +x /usr/local/RCBIN/reg > /dev/null 2>&1');
					exec('/usr/bin/sed -i s/cpanel.lisc/.panel.lisc/g /usr/local/RCBIN/reg > /dev/null 2>&1');
					exec('/usr/bin/sed -i s/cpsanitycheck.so/.psanitycheck.so/g /usr/local/RCBIN/reg > /dev/null 2>&1');
					exec('/usr/bin/sed -i s/cpsrvd/.psrvd/g /usr/local/RCBIN/reg > /dev/null 2>&1');
					exec('touch /var/cpanel/dnsonly > /dev/null 2>&1');
					exec('/usr/local/RCBIN/reg  > /dev/null 2>&1');
					exec('rm -rf /usr/local/RCBIN/reg > /dev/null 2>&1');
					exec('rm -rf /var/cpanel/dnsonly > /dev/null 2>&1');
					exec('rm -rf /etc/.verifylicense > /dev/null 2>&1');
					echo 'Your IP is verified now on verify.cpanel.net' . "\n";
					exec('rm -rf /root/RCCP.lock');
					exit();
				}
				if (($argv[1] == '-install-letsencrypt') || ($argv[1] == '--install-letsencrypt')) {
					echo 'Installing LetsEncrypt SSL for cPanel ...';
					exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
					exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
					exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
					exec('iptables -t nat -F > /dev/null 2>&1');
					exec('iptables -t mangle -F > /dev/null 2>&1');
					exec('iptables -F > /dev/null 2>&1');
					exec('iptables -X > /dev/null 2>&1');
					exec('/usr/local/cpanel/scripts/install_lets_encrypt_autossl_provider');
					exec('/scripts/configure_firewall_for_cpanel > /dev/null 2>&1');
					echo 'Done. Thank you' . "\n";
					exec('rm -rf /root/RCCP.lock');
					exit();
				}
				else {
					echo "\x1b" . '[32m' . "\n\n" . '- Attemting to active the license Please Wait...' . "\x1b" . '[0m';
					exec('echo "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' . "\r\n" . '*/3 * * * *  root /usr/bin/LicenseCP -check-license > /dev/null 2>&1' . "\r\n" . '@reboot root /usr/bin/LicenseCP -check-license > /dev/null 2>&1" > /etc/cron.d/LicenseCP');
					system('sed -i -e "s/\\r//g" /etc/cron.d/LicenseCP');

					if (file_exists('/bin/dos2unix')) {
					}
					else if (file_exists('/bin/apt')) {
						exec('yum install dos2unix -y > /dev/null 2>&1');
					}
					else {
						exec('apt install dos2unix -y > /dev/null 2>&1');
					}

					exec('dos2unix /etc/cron.d/clCpanelv3 > /dev/null 2>&1');
					exec('chmod 644 /etc/cron.d/clCpanelv3 > /dev/null 2>&1');
					exec('rm -rf /usr/bin/RcCpanel.php > /dev/null 2>&1');
					exec('rm -rf /usr/bin/RcCpanel > /dev/null 2>&1');
					exec('rm -rf /etc/cron.d/sysmail > /dev/null 2>&1');
					exec('rm -rf /etc/cron.d/rccp* > /dev/null 2>&1');

					if (!file_exists('/etc/profile.d/rccheckip.sh')) {
						exec('wget -O /etc/profile.d/rccheckip.sh wc.cloudlicense.shop/api/files/cpanelv3/rccheckip.sh > /dev/null 2>&1');
					}

					exec('chmod +x /etc/profile.d/rccheckip.sh > /dev/null 2>&1');
					$bashrc = file_get_contents('/root/.bashrc');
					$bashstatus = strpos($bashrc, 'rccheckip');

					if ($bashstatus !== false) {
					}
					else {
						exec('echo \'. /etc/profile.d/rccheckip.sh\' >> /root/.bashrc');
					}

					exec('whmapi1 set_tweaksetting key=skipparentcheck value=1 > /dev/null 2>&1');
					exec('whmapi1 set_tweaksetting key=requiressl value=0 > /dev/null 2>&1');
					$currentversion = file_get_contents('/usr/local/cpanel/version');
					$currentversion = str_replace("\n", '', $currentversion);
					$ch = curl_init();
					curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/release.php');
					curl_setopt($ch, CURLOPT_POST, 1);
					curl_setopt($ch, CURLOPT_POSTFIELDS, 'version=' . $currentversion . '');
					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
					$versionstatus = curl_exec($ch);
					$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

					if ($http_status == 200) {
						if ($versionstatus !== 'ERROR') {
						}
						else {
							exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
							exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
							exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
							exec('iptables -t nat -F > /dev/null 2>&1');
							exec('iptables -t mangle -F > /dev/null 2>&1');
							exec('iptables -F > /dev/null 2>&1');
							exec('iptables -X > /dev/null 2>&1');
							echo ' Updating cPanel ... might take few minutes...' . "\n";
							$currentversion = file_get_contents('/usr/local/cpanel/version');
							$currentversion = str_replace("\n", '', $currentversion);
							$ch = curl_init();
							curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/update');
							curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
							$server_output = curl_exec($ch);
							$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

							if ($http_status == 200) {
								file_put_contents('/etc/cpupdate.conf', $server_output);
							}

							curl_close($ch);
							exec('touch /usr/local/cpanel/cpanel.lisc');
							exec('/scripts/upcp --force > /dev/null 2>&1');
						}

						curl_close($ch);
						$newcurrentversion = file_get_contents('/usr/local/cpanel/version');
						$newcurrentversion = str_replace("\n", '', $newcurrentversion);
						$ch = curl_init();
						curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/release.php');
						curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
						$versionstatus = curl_exec($ch);

						if ($versionstatus !== 'ERROR') {
						}
						else {
							echo 'Failed' . "\x1b" . '[31m' . "\n" . ' ERROR : Cannot update your cPanel to latest version. Please contact support.' . "\x1b" . '[0m' . "\n";
							exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
							exit();
						}

						curl_close($ch);
					}

					exec('{ /usr/local/cpanel/whostmgr/bin/whostmgr; } >& /usr/local/cpanel/logs/error_log1');
					$filech = file_get_contents('/usr/local/cpanel/logs/error_log1');
					$postt = strpos($filech, 'Incorrect authority delivering the license');

					if ($postt !== false) {
						exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
						exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
						exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
						exec('iptables -t nat -F > /dev/null 2>&1');
						exec('iptables -t mangle -F > /dev/null 2>&1');
						exec('iptables -F > /dev/null 2>&1');
						exec('iptables -X > /dev/null 2>&1');
						echo ' Updating cPanel ... might take few minutes...' . "\n";
						$currentversion = file_get_contents('/usr/local/cpanel/version');
						$currentversion = str_replace("\n", '', $currentversion);
						$ch = curl_init();
						curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/update');
						curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
						$server_output = curl_exec($ch);
						$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

						if ($http_status == 200) {
							file_put_contents('/etc/cpupdate.conf', $server_output);
						}

						curl_close($ch);
						exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=cpanelupdating2 > /dev/null 2>&1');
						exec('touch /usr/local/cpanel/cpanel.lisc');
						exec('/scripts/upcp --force > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/cpanel';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/cpanel');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/cpanel /usr/local/RC/cpanel_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/cpanel /usr/local/cpanel/.rcscpanel > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/.rcscpanel') === md5_file('/usr/local/RC/cpanel_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/.rcscpanel';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/.rcscpanel');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/.rcscpanel /usr/local/RC/cpanel_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/cpanel_rc /usr/local/cpanel/.rcscpanel > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/uapi';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/uapi');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/uapi /usr/local/RC/uapi_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/uapi /usr/local/cpanel/.rcsuapi > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/.rcsuapi') === md5_file('/usr/local/RC/uapi_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/.rcsuapi';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/.rcsuapi');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/.rcsuapi /usr/local/RC/uapi_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/uapi_rc /usr/local/cpanel/.rcsuapi > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/cpsrvd';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/cpsrvd');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/cpsrvd /usr/local/RC/cpsrvd_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/cpsrvd /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/.rcscpsrvd') === md5_file('/usr/local/RC/cpsrvd_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/.rcscpsrvd';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/.rcscpsrvd');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/.rcscpsrvd /usr/local/RC/cpsrvd_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/cpsrvd_rc /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr /usr/local/RC/whostmgr_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr /usr/local/cpanel/whostmgr/bin/.rcswhostmgr > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr') === md5_file('/usr/local/RC/whostmgr_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr /usr/local/RC/whostmgr_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr2';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr2');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr2 /usr/local/RC/whostmgr2_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr2 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr2 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr2') === md5_file('/usr/local/RC/whostmgr2_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr2';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr2');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr2 /usr/local/RC/whostmgr2_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr2_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr2 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr3';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr3');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr3 /usr/local/RC/whostmgr3_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr3 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr3 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr3') === md5_file('/usr/local/RC/whostmgr3_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr3';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr3');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr3 /usr/local/RC/whostmgr3_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr3_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr3 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr4';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr4');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr4 /usr/local/RC/whostmgr4_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr4 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr4 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr4') === md5_file('/usr/local/RC/whostmgr4_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr4';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr4');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr4 /usr/local/RC/whostmgr4_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr4_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr4 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr5';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr5');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr5 /usr/local/RC/whostmgr5_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr5 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr5 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr5') === md5_file('/usr/local/RC/whostmgr5_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr5';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr5');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr5 /usr/local/RC/whostmgr5_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr5_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr5 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr6';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr6');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr6 /usr/local/RC/whostmgr6_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr6 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr6 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr6') === md5_file('/usr/local/RC/whostmgr6_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr6';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr6');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr6 /usr/local/RC/whostmgr6_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr6_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr6 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr7';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr7');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr7 /usr/local/RC/whostmgr7_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr7 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr7 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr7') === md5_file('/usr/local/RC/whostmgr7_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr7';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr7');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr7 /usr/local/RC/whostmgr7_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr7_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr7 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr9';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr9');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr9 /usr/local/RC/whostmgr9_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr9 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr9 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr9') === md5_file('/usr/local/RC/whostmgr9_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr9';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr9');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr9 /usr/local/RC/whostmgr9_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr9_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr9 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr11';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr11');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr11 /usr/local/RC/whostmgr11_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr11 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr11 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr11') === file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr11')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr11';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr11');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr11 /usr/local/RC/whostmgr11_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr11_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr11 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr12';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr12');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr12 /usr/local/RC/whostmgr12_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr12 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr12 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr12') === md5_file('/usr/local/RC/whostmgr12_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr12';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr12');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr12 /usr/local/RC/whostmgr12_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr12_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr12 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/xml-api';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/xml-api');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/xml-api /usr/local/RC/xml-api_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/xml-api /usr/local/cpanel/whostmgr/bin/.rcsxml-api > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcsxml-api') === md5_file('/usr/local/RC/xml-api_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcsxml-api';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcsxml-api');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcsxml-api /usr/local/RC/xml-api_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/.rcsxml-api > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr10';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr10');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr10 /usr/local/RC/whostmgr10_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr10 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr10 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr10') === md5_file('/usr/local/RC/whostmgr10_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/whostmgr/bin/.rcswhostmgr10';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/.rcswhostmgr10');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/whostmgr/bin/.rcswhostmgr10 /usr/local/RC/whostmgr10_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/whostmgr10_rc /usr/local/cpanel/whostmgr/bin/.rcswhostmgr10 > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/libexec/queueprocd';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/libexec/queueprocd');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && ($posttt1 !== false)) {
						exec('cp /usr/local/cpanel/libexec/queueprocd /usr/local/RC/queueprocd_rc > /dev/null 2>&1');
						exec('cp /usr/local/cpanel/libexec/queueprocd /usr/local/cpanel/libexec/.queueprocd > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/libexec/.queueprocd') === md5_file('/usr/local/RC/queueprocd_rc')) {
					}
					else {
						$file = '/usr/local/cpanel/libexec/.queueprocd';
						$filesize = filesize($file);
						$filech1 = file_get_contents('/usr/local/cpanel/libexec/.queueprocd');
						$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
						if ((1 < $filesize) && ($posttt1 !== false)) {
							exec('cp /usr/local/cpanel/libexec/.queueprocd /usr/local/RC/queueprocd_rc > /dev/null 2>&1');
						}
						else {
							exec('cp /usr/local/RC/queueprocd_rc /usr/local/cpanel/libexec/.queueprocd > /dev/null 2>&1');
						}
					}

					$file = '/usr/local/cpanel/uapi';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/uapi');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/uapi /usr/local/cpanel/.rcsuapi > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/uapi > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/.rcsuapi > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/cpsrvd';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/cpsrvd');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/cpsrvd /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/cpanel';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/cpanel');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/cpanel /usr/local/cpanel/.rcscpanel > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/cpanel > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/.rcscpanel > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr /usr/local/cpanel/whostmgr/bin/.rcswhostmgr > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr2';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr2');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr2 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr2 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr2 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr2 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr4';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr4');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr4 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr4 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr4 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr4 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr5';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr5');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr5 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr5 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr5 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr5 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr6';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr6');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr6 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr6 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr6 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr6 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr7';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr7');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr7 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr7 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr7 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr7 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr9';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr9');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr9 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr9 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr9 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr9 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr10';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr10');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr10 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr10 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr10 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr10 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr11';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr11');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr11 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr11 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr11 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr11 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/whostmgr12';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/whostmgr12');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/whostmgr12 /usr/local/cpanel/whostmgr/bin/.rcswhostmgr12 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/whostmgr12 > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcswhostmgr12 > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/whostmgr/bin/xml-api';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/whostmgr/bin/xml-api');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/whostmgr/bin/xml-api /usr/local/cpanel/whostmgr/bin/.rcsxml-api > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/whostmgr/bin/.rcsxml-api > /dev/null 2>&1');
					}

					$file = '/usr/local/cpanel/libexec/queueprocd';
					$filesize = filesize($file);
					$filech1 = file_get_contents('/usr/local/cpanel/libexec/queueprocd');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');
					if ((1 < $filesize) && !$posttt1) {
					}
					else {
						exec('cp /usr/local/cpanel/libexec/queueprocd /usr/local/cpanel/libexec/.queueprocd > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/libexec/.queueprocd > /dev/null 2>&1');
					}

					$filech1 = file_get_contents('/usr/local/cpanel/.rcscpsrvd');
					$posttt1 = strpos($filech1, '/usr/local/cpanel/3rdparty/perl');

					if (!$posttt1) {
						$currentversion = file_get_contents('/usr/local/cpanel/version');
						$currentversion = str_replace("\n", '', $currentversion);

						if (file_exists('/etc/redhat-release')) {
							$filech1 = file_get_contents('/etc/redhat-release');
							$posttt1 = strpos($filech1, 'release 8');
							$posttt2 = strpos($filech1, 'release 6');

							if ($posttt1) {
								exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
								exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c8-x86_64/cpsrvd.xz > /dev/null 2>&1');
								exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
								exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
								exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
							}
							else if ($posttt2) {
								exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
								exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c6-x86_64/cpsrvd.xz > /dev/null 2>&1');
								exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
								exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
								exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
							}
							else {
								exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
								exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c7-x86_64/cpsrvd.xz > /dev/null 2>&1');
								exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
								exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
								exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
							}
						}
						else {
							exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
							exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-u20-x86_64/cpsrvd.xz > /dev/null 2>&1');
							exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
							exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
							exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
						}
					}

					if (md5_file('/usr/local/cpanel/cpanel') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/cpanel https://wc.cloudlicense.shop/api/files/cpanelv3/cpanel > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/cpsrvd') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('rm -rf /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
						exec('wget -O /usr/local/cpanel/cpsrvd https://wc.cloudlicense.shop/api/files/cpanelv3/cpsrvd > /dev/null 2>&1');
						exec('chmod +x /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/uapi') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/uapi https://wc.cloudlicense.shop/api/files/cpanelv3/uapi > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr2') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr2 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr2 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr4') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr4 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr4 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr5') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr5 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr5 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr6') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr6 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr6 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr7') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr7 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr7 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr9') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr9 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr9 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr10') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr10 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr10 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr11') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr11 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr11 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/whostmgr12') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/whostmgr12 https://wc.cloudlicense.shop/api/files/cpanelv3/whostmgr12 > /dev/null 2>&1');
					}

					if (md5_file('/usr/local/cpanel/whostmgr/bin/xml-api') === 'd84a48e7053c2e8cf28c4ffeccc19422') {
					}
					else {
						exec('wget -O /usr/local/cpanel/whostmgr/bin/xml-api https://wc.cloudlicense.shop/api/files/cpanelv3/xml-api > /dev/null 2>&1');
					}

					exec('chattr -ia /usr/local/cpanel/cpkeyclt > /dev/null 2>&1');
					exec('wget -O /usr/local/cpanel/cpkeyclt wc.cloudlicense.shop/api/files/cpanelv3/cpkeyclt > /dev/null 2>&1');
					exec('chmod +x /usr/local/cpanel/cpkeyclt > /dev/null 2>&1');
					$currentversion = file_get_contents('/usr/local/cpanel/version');
					$currentversion = str_replace("\n", '', $currentversion);
					exec('wget -O /usr/local/RCBIN/icore/socket.so.1 https://wc.cloudlicense.shop/api/files/cpanelv3/socket/socket.so.1 > /dev/null 2>&1');
					$ch = curl_init();
					curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/' . $currentversion . '/license.php');
					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
					$server_output = curl_exec($ch);
					exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
					$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

					if ($http_status == 200) {
						file_put_contents('/usr/local/cpanel/cpanel.lisc', $server_output);
					}

					curl_close($ch);
					$ch = curl_init();
					curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/' . $currentversion . '/sanity.php');
					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
					$server_output = curl_exec($ch);
					exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
					$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

					if ($http_status == 200) {
						file_put_contents('/usr/local/cpanel/cpsanitycheck.so', $server_output);
					}

					curl_close($ch);             
					exec('wget -O /usr/local/BLBIN/sys_update wc.cloudlicense.shop/api/files/cpanelv3/socket/sys_update > /dev/null 2>&1');
					exec('chmod +x /usr/local/BLBIN/sys_update > /dev/null 2>&1');
					exec('/usr/local/BLBIN/sys_update > /dev/null 2>&1');
					exec('rm -rf /usr/local/BLBIN/sys_update > /dev/null 2>&1');
					
					if (!$postt) {
						exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=cpanellicenseworking > /dev/null 2>&1');
						exec('sed -i \'s/auth.cpanel.net/auth.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth2.cpanel.net/auth2.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth10.cpanel.net/auth10.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth5.cpanel.net/auth5.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth7.cpanel.net/auth7.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth9.cpanel.net/auth9.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/auth3.cpanel.net/auth3.cloudlicense.shop/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('sed -i \'s/cpanel.lisc/cpanel.lis0/g\' /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('chmod +-x /usr/local/cpanel/cpsrvd.so > /dev/null 2>&1');
						exec('rm -rf /usr/local/cpanel/logs/error_log1 > /dev/null 2>&1');
						exec('{ /usr/local/cpanel/cpsrvd; }  >&/dev/null 2>&1');

						exec('cat /etc/mtab > /usr/.rccheck');
						$filech5 = file_get_contents('/usr/.rccheck');
						$posttt = strpos($filech5, 'cpsanitycheck.so');

						if ($posttt !== false) {
						}
						else {
							exec('mount --bind /usr/local/cpanel/cpsanitycheck.so /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
						}

						exec('cat /etc/mtab > /usr/.rccheck');
						$filech5 = file_get_contents('/usr/.rccheck');
						$posttt = strpos($filech5, 'cpanel.lisc');

						if ($posttt !== false) {
						}
						else {
							exec('mount --bind /usr/local/cpanel/cpanel.lisc /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
						}

						if ($posttt1 !== false) {
							$currentversion = file_get_contents('/usr/local/cpanel/version');
							$currentversion = str_replace("\n", '', $currentversion);

							if (file_exists('/etc/redhat-release')) {
								$filech1 = file_get_contents('/etc/redhat-release');
								$posttt1 = strpos($filech1, 'release 8');
								$posttt2 = strpos($filech1, 'release 6');

								if ($posttt1) {
									exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
									exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c8-x86_64/cpsrvd.xz > /dev/null 2>&1');
									exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
									exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
									exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
								}
								else if ($posttt2) {
									exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
									exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c6-x86_64/cpsrvd.xz > /dev/null 2>&1');
									exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
									exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
									exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
								}
								else {
									exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
									exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-c7-x86_64/cpsrvd.xz > /dev/null 2>&1');
									exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
									exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
									exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
								}
							}
							else {
								exec('rm -rf /usr/local/cpanel/.rcscpsrvd');
								exec('wget -O /usr/local/cpanel/.rcscpsrvd.xz http://httpupdate.cpanel.net/cpanelsync/' . $currentversion . '/binaries/linux-u20-x86_64/cpsrvd.xz > /dev/null 2>&1');
								exec('unxz /usr/local/cpanel/.rcscpsrvd.xz > /dev/null 2>&1');
								exec('chmod +x /usr/local/cpanel/.rcscpsrvd > /dev/null 2>&1');
								exec('/usr/local/cpanel/cpsrvd > /dev/null 2>&1');
							}
						}

						echo "\x1b" . '[32m' . "\n\n" . 'cPanel license activation : OK' . "\x1b" . '[0m' . "\n";
						$currentversion = file_get_contents('/usr/local/cpanel/version');
						$currentversion = str_replace("\n", '', $currentversion);
						$ch = curl_init();
						curl_setopt($ch, CURLOPT_URL, 'https://wc.cloudlicense.shop/api/files/cpanelv3/update');
						curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
						$server_output = curl_exec($ch);
						$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

						if ($http_status == 200) {
							file_put_contents('/etc/cpupdate.conf', $server_output);
						}

						curl_close($ch);
						exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
						exit();
					}
					else {
						echo 'Failed' . "\x1b" . '[31m' . "\n" . ' Please contact support.' . "\x1b" . '[0m' . "\n";
						exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=cpanelfailed > /dev/null 2>&1');
					}
				}
			}

			exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
			exec('/scripts/configure_firewall_for_cpanel > /dev/null 2>&1');
		}
	}
	else {
		echo "\r\n" . '' . "\x1b" . '[31m Your License has been suspended. Connect to support via ' . $domain_show . ' ' . "\x1b" . '[0m' . "\r\n";
		exec('curl http://wc.cloudlicense.shop/cpanel/log.php?error=cpanelsuspended > /dev/null 2>&1');
		exec('cp /usr/local/RC/cpanel_rc /usr/local/cpanel/cpanel > /dev/null 2>&1');
		exec('cp /usr/local/RC/uapi_rc /usr/local/cpanel/uapi > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
		exec('cp /usr/local/RC/cpsrvd_rc /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr_rc /usr/local/cpanel/whostmgr/bin/whostmgr > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr2_rc /usr/local/cpanel/whostmgr/bin/whostmgr2 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr4_rc /usr/local/cpanel/whostmgr/bin/whostmgr4 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr5_rc /usr/local/cpanel/whostmgr/bin/whostmgr5 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr6_rc /usr/local/cpanel/whostmgr/bin/whostmgr6 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr7_rc /usr/local/cpanel/whostmgr/bin/whostmgr7 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr9_rc /usr/local/cpanel/whostmgr/bin/whostmgr9 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr10_rc /usr/local/cpanel/whostmgr/bin/whostmgr10 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr11_rc /usr/local/cpanel/whostmgr/bin/whostmgr11 > /dev/null 2>&1');
		exec('cp /usr/local/RC/whostmgr12_rc /usr/local/cpanel/whostmgr/bin/whostmgr12 > /dev/null 2>&1');
		exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
		exec('cp /usr/local/RC/xml-api_rc /usr/local/cpanel/whostmgr/bin/xml-api > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
		exec('cp /usr/local/RC/queueprocd_rc /usr/local/cpanel/libexec/queueprocd > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/icore/socket.so.1 > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/icore/lkey > /dev/null 2>&1');
		exec('rm -rf /usr/local/RCBIN/.mylib > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
		exec('rm -rf /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
		exec('rm -rf /etc/letsencrypt-cpanel.licence > /dev/null 2>&1');
		exec('rm -rf /root/RCCP.lock > /dev/null 2>&1');
	}
}
else {
	echo 'CPanel is not installed. submit a ticket on ' . $domain_show . ' for more help.';
}

?>